import { exInputNumber, exSwitch, exInput, exSelect } from '@ve/common/components/extension'

export default {
  VERSION: '20220408',
  type: 'uiChartCard',
  name: '图表盒子',
  icon: 'checkbox-blank-line',
  svg: 'tubiao',
  data: {
    requestData: {},
    formData: {},
  },
  dataSourceBind: {
    sourceId: {
      type: 'exGetDataSource',
      name: '组件ID',
      value: {
        type: 1,
        source: [],
      },
    },
    // dataKey: exInput('数据Key', ''),
    getDataKey: exInput('数据Key', '', '获取数据的 key 的集合，多个 key 用 “,” 分隔，如需获取全部数据则不填写'),
    hasParam: exSwitch('当参数用', false, '默认当数据使用,开启当参数使用'),
    getArrayIndex: exInput('指定数据', 'all', '数据是数组默认使用all 可指定下标'),
  },
  //数据别名
  // dataName: 'uiFlexbox_data',
  //扩展
  extension: {
    showAuto: exSwitch('是否是像素盒子', true),
    autoHeight: exInputNumber('像素高度', 100, 1, 10000),
    boxHeight: exInputNumber('高度', 50, 1, 100),
    showTimeRange: exSwitch('时间选择', false),
    flexDer: exSelect('子组件排布方向', 'row', [
      {
        label: '横',
        value: 'row',
      },
      {
        label: '竖',
        value: 'col',
      },
    ]),
    justifyAlign: {
      type: 'exRadioGroup',
      name: '水平位置',
      value: 'start',
      list: [
        {
          label: '居左',
          value: 'start',
        },
        {
          label: '居中',
          value: 'center',
        },
        {
          label: '居右',
          value: 'end',
        },
      ],
    },
    itemsAlign: {
      type: 'exRadioGroup',
      name: '垂直方向',
      value: 'flex-start',
      list: [
        {
          label: '居上',
          value: 'flex-start',
        },
        {
          label: '居中',
          value: 'center',
        },
        {
          label: '居下',
          value: 'flex-end',
        },
      ],
    },
    padding: {
      type: 'exInputNumber',
      name: '内边距',
      value: 1,
      min: 0,
      max: 12,
    },
    justify: {
      type: 'exJustifySelect',
      name: '换行',
      value: 'flex-wrap',
    },
    shadow: {
      type: 'exShadowSelect',
      name: '盒阴影',
      value: 'shadow-none',
    },
    border: {
      type: 'exBorderSelect',
      name: '边框厚度',
      value: 'border-0',
    },
    rounded: {
      type: 'exRoundedSelect',
      name: '边框圆角',
      value: 'rounded-none',
    },
    bg: {
      type: 'exBgColorSelect',
      name: '背景颜色',
      value: 'bg-white',
    },
    labelText: {
      type: 'exInput',
      name: '标签',
      value: '',
    },
    labeljustifyAlign: {
      type: 'exRadioGroup',
      name: '水平位置',
      value: 'start',
      list: [
        {
          label: '居左',
          value: 'start',
        },
        {
          label: '居中',
          value: 'center',
        },
        {
          label: '居右',
          value: 'end',
        },
      ],
    },
    labelitemsAlign: {
      type: 'exRadioGroup',
      name: '垂直方向',
      value: 'flex-start',
      list: [
        {
          label: '居上',
          value: 'flex-start',
        },
        {
          label: '居中',
          value: 'center',
        },
        {
          label: '居下',
          value: 'flex-end',
        },
      ],
    },
    topMargin: {
      type: 'exInputNumber',
      name: '上外边距',
      value: 0,
    },
    rightMargin: {
      type: 'exInputNumber',
      name: '右外边距',
      value: 0,
    },
    bottomMargin: {
      type: 'exInputNumber',
      name: '下外边距',
      value: 0,
    },
    leftMargin: {
      type: 'exInputNumber',
      name: '左外边距',
      value: 0,
    },
    showBrage: exSwitch('显示角标', true),
    borderWidth: exInputNumber('角标粗细', 1, 1, 500),
    brageWidth: exInputNumber('角标线宽', 15, 1, 500),
    brageLine: exInputNumber('角标线长', 15, 1, 500),
    brageRotate: exInputNumber('角标圆角', 0, 0, 500),
    brageColorLeftTop: {
      type: 'exSetChartColor',
      name: '角标颜色-左上',
      value: '#9271D5',
    },
    brageColorLeftBottom: {
      type: 'exSetChartColor',
      name: '角标颜色-左下',
      value: '#9271D5',
    },
    brageColorRightBottom: {
      type: 'exSetChartColor',
      name: '角标颜色-右下',
      value: '#9271D5',
    },
    brageColorRightTop: {
      type: 'exSetChartColor',
      name: '角标颜色-右上',
      value: '#9271D5',
    },
    backgroundColor: {
      type: 'exSetChartColor',
      name: '背景颜色',
      value: '#fff',
    },
    showTitle: exSwitch('显示标题', true),
    title: exInput('标题内容', '测试标题'),
    titleBgColor: {
      type: 'exSetChartColor',
      name: '标题背景',
      value: '#D7CBEE',
    },
    titleHeight: exInputNumber('标题高度', 25, 1, 500),

    titleRadius: {
      type: 'exInputNumber',
      name: '标题圆角',
      value: 0,
    },
    titleTopMargin: {
      type: 'exInputNumber',
      name: '标题上外边距',
      value: 0,
    },
    titleRightMargin: {
      type: 'exInputNumber',
      name: '标题右外边距',
      value: 0,
    },
    titleBottomMargin: {
      type: 'exInputNumber',
      name: '标题下外边距',
      value: 0,
    },
    titleLeftMargin: {
      type: 'exInputNumber',
      name: '标题左外边距',
      value: 0,
    },
    titleTopPadding: {
      type: 'exInputNumber',
      name: '标题上内边距',
      value: 5,
    },
    titleRightPadding: {
      type: 'exInputNumber',
      name: '标题右内边距',
      value: 0,
    },
    titleBottomPadding: {
      type: 'exInputNumber',
      name: '标题下内边距',
      value: 5,
    },
    titleLeftPadding: {
      type: 'exInputNumber',
      name: '标题左内边距',
      value: 7,
    },
    titleFontSize: {
      type: 'exInputNumber',
      name: '标题字体大小',
      value: 12,
    },
    titleColor: {
      type: 'exSetChartColor',
      name: '标题字体颜色',
      value: '#fff',
    },
    titleFontWeight: exSelect('字体粗细', 500, [
      {
        label: '正常',
        value: 500,
      },
      {
        label: '加粗',
        value: 600,
      },
      {
        label: '特粗',
        value: 700,
      },
    ]),
    backgroundImg: {
      type: 'exUpload',
      name: '背景图片',
      value: '',
    },
    showBorder: exSwitch('是否显示border', false),
    cardBorderWidth: exInputNumber('卡片border粗细', 1, 1, 500),
    cardBorderRadius: exInputNumber('卡片border圆角', 20, 1, 500),
    cardBordercolor: {
      type: 'exSetChartColor',
      name: '卡片border颜色',
      value: '#9271D5',
    },
    cardBorderType: exSelect('卡片border样式', 'solid', [
      {
        label: '点线',
        value: 'dotted',
      },
      {
        label: '虚线',
        value: 'dashed',
      },
      {
        label: '实线',
        value: 'solid',
      },
      {
        label: '双实线',
        value: 'double',
      },
    ]),
    backgroundSize: exSelect('标题图片类型', 'contain', [
      {
        label: '宽高自适应缩放',
        value: 'contain',
      },
      {
        label: '铺满盒子',
        value: 'cover',
      },
    ]),
    backgroundPosition: exSelect('标题图片位置', 'left', [
      {
        label: '左',
        value: 'left',
      },
      {
        label: '中',
        value: 'center',
      },
      {
        label: '右',
        value: 'right',
      },
    ]),
    titleBackgroundImg: {
      type: 'exUpload',
      name: '标题背景图片',
      value: '',
    },
  },
  list: [],
  interaction: [],
  //条件、逻辑指令
  logicInstruction: [],
}
